﻿$(function () {

	//切换上下移动
	var QieHuan_PanDuan = false;
	$(".QieHuan>a").click(function () {
		//登出回收
		if (DengChu_PanDuan == true) {
			$(".Top_TiShi_DengChu").animate({
				top: -80
			}, 500, function () {
				$(".XianTiao_Yi_Shang").css("left", "-200px");
				$(".XianTiao_Yi_You").css("height", "0px");
				$(".XianTiao_Yi_Xia").css("right", "-300px");
				$(".XianTiao_Yi_Zuo").css("top", "130px");
				DengChu_PanDuan = false;
			});
		}

		if (QieHuan_PanDuan == false) {

			

			//线条移动
			$(".Top_TiShi_QieHuan").animate({
				top: 60
			}, 500, function () {
					

				// 切换确定按钮事件
				var QieHuan_but_Yes_Jishu = 0;
				var QieHuan_but_Yes_Time1 = setInterval(function () { });
				var QieHuan_but_Yes_Time2 = setInterval(function () { });

				$(".QieHuan_but_Yes").mouseenter(function () {
					clearInterval(QieHuan_but_Yes_Time2);
					QieHuan_but_Yes_Time1 = setInterval(function () {
						$(".QieHuan_but_Yes").css("box-shadow", "0px 0px " + QieHuan_but_Yes_Jishu + "px 0px #FF0000");
						$(".QieHuan_but_Yes").css("text-shadow", "#FF0000 0px 0px " + QieHuan_but_Yes_Jishu + "px");
						QieHuan_but_Yes_Jishu++;
						if (QieHuan_but_Yes_Jishu >= 15) {
							clearInterval(QieHuan_but_Yes_Time1);
						}
					}, 10)
				}).mouseleave(function () {
					clearInterval(QieHuan_but_Yes_Time1);
					QieHuan_but_Yes_Time2 = setInterval(function () {
						$(".QieHuan_but_Yes").css("box-shadow", "0px 0px " + QieHuan_but_Yes_Jishu + "px 0px #FF0000");
						$(".QieHuan_but_Yes").css("text-shadow", "#FF0000 0px 0px " + QieHuan_but_Yes_Jishu + "px");
						QieHuan_but_Yes_Jishu--;
						if (QieHuan_but_Yes_Jishu <= -1) {
							clearInterval(QieHuan_but_Yes_Time2);
						}
					}, 10)
				})
				//切换取消按钮事件
				var QieHuan_but_No_Jishu = 0;
				var QieHuan_but_No_Time1 = setInterval(function () { });
				var QieHuan_but_No_Time2 = setInterval(function () { });
				$(".QieHuan_but_No").click(function () {
					if (QieHuan_PanDuan == true) {
						$(".Top_TiShi_QieHuan").animate({
							top: -100
						}, 500, function () {
							$(".QieHuan_XiaoTiao_Top").css("right", "305px");
							$(".QieHuan_XiaoTiao_You").css("top", "-146px");
							$(".QieHuan_XiaoTiao_Xia").css("right", "-247px");
							$(".QieHuan_XiaoTiao_Zuo").css("top", "23px");
							QieHuan_PanDuan = false;
						});
					}
				}).mouseenter(function () {
					clearInterval(QieHuan_but_No_Time2);
					QieHuan_but_No_Time1 = setInterval(function () {
						$(".QieHuan_but_No").css("box-shadow", "0px 0px " + QieHuan_but_No_Jishu + "px 0px #33FFFF");
						$(".QieHuan_but_No").css("text-shadow", "#33FFFF 0px 0px " + QieHuan_but_No_Jishu + "px");
						QieHuan_but_No_Jishu++;
						if (QieHuan_but_No_Jishu >= 15) {
							clearInterval(QieHuan_but_No_Time1);
						}
					}, 10)
				}).mouseleave(function () {
					clearInterval(QieHuan_but_No_Time1);
					QieHuan_but_No_Time2 = setInterval(function () {
						$(".QieHuan_but_No").css("box-shadow", "0px 0px " + QieHuan_but_No_Jishu + "px 0px #33FFFF");
						$(".QieHuan_but_No").css("text-shadow", "#33FFFF 0px 0px " + QieHuan_but_No_Jishu + "px");
						QieHuan_but_No_Jishu--;
						if (QieHuan_but_No_Jishu <= -1) {
							clearInterval(QieHuan_but_No_Time2);
						}
					}, 10)
				})
				//切换线条移动
				$(".QieHuan_XiaoTiao_Zuo").animate({
					top: 0
				}, 150, function () {
					$(".QieHuan_XiaoTiao_Top").animate({
						right: 0
					}, 450, function () {
						$(".QieHuan_XiaoTiao_You").animate({
							top: 0
						}, 250, function () {
							$(".QieHuan_XiaoTiao_Xia").animate({
								right: 0
							}, 300, function () {
								QieHuan_PanDuan = true;
							})
						})
					})
				})
			})
		}
		if (QieHuan_PanDuan == true) {
			$(".Top_TiShi_QieHuan").animate({
				top: -100
			}, 500, function () {
				$(".QieHuan_XiaoTiao_Top").css("right", "305px");
				$(".QieHuan_XiaoTiao_You").css("top", "-146px");
				$(".QieHuan_XiaoTiao_Xia").css("right", "-247px");
				$(".QieHuan_XiaoTiao_Zuo").css("top", "23px");
				QieHuan_PanDuan = false;
			});
		}
	})

	//登出上下移动
	var DengChu_PanDuan = false;
	$(".DengChu>a").click(function () {
		//切换回收
		if (QieHuan_PanDuan == true) {
			$(".Top_TiShi_QieHuan").animate({
				top: -100
			}, 500, function () {
				$(".QieHuan_XiaoTiao_Top").css("right", "305px");
				$(".QieHuan_XiaoTiao_You").css("top", "-146px");
				$(".QieHuan_XiaoTiao_Xia").css("right", "-247px");
				$(".QieHuan_XiaoTiao_Zuo").css("top", "23px");
				QieHuan_PanDuan = false;
			});
		}
		if (DengChu_PanDuan == false) {
			$(".Top_TiShi_DengChu").animate({
				top: 60
			}, 500, function () {


				//确定登出提示泛光
				var time1 = setInterval(function () { });
				var time2 = setInterval(function () { });
				var DengChu_TiShi_Jishu = 0;
				$(".DengChu_TiShi").mouseenter(function () {
					time1 = setInterval(function () {
						clearInterval(time2);
						$(".DengChu_TiShi").css("textShadow", "#74d4c0 0px 0px " + DengChu_TiShi_Jishu + "px");
						DengChu_TiShi_Jishu++;
						if (DengChu_TiShi_Jishu >= 15) {
							clearInterval(time1);
						}
					}, 50)
				}).mouseleave(function () {
					clearInterval(time1);
					time2 = setInterval(function () {
						$(".DengChu_TiShi").css("textShadow", "#74d4c0 0px 0px " + DengChu_TiShi_Jishu + "px");
						DengChu_TiShi_Jishu--;
						if (DengChu_TiShi_Jishu <= -1) {
							clearInterval(time2);
						}
					}, 50)
				})
				//登出确定按钮事件
				var DengChu_but_Yes_Jishu = 0;
				var DengChu_but_Yes_Time1 = setInterval(function () { });
				var DengChu_but_Yes_Time2 = setInterval(function () { });
				$(".DengChu_but_Yes").click(function () {

					//需要跳转

				}).mouseenter(function () {
					clearInterval(DengChu_but_Yes_Time2);
					DengChu_but_Yes_Time1 = setInterval(function () {
						$(".DengChu_but_Yes").css("box-shadow", "0px 0px " + DengChu_but_Yes_Jishu + "px 0px #FF0000");
						$(".DengChu_but_Yes").css("text-shadow", "#FF0000 0px 0px " + DengChu_but_Yes_Jishu + "px");
						DengChu_but_Yes_Jishu++;
						if (DengChu_but_Yes_Jishu >= 15) {
							clearInterval(DengChu_but_Yes_Time1);
						}
					}, 10)
				}).mouseleave(function () {
					clearInterval(DengChu_but_Yes_Time1);
					DengChu_but_Yes_Time2 = setInterval(function () {
						$(".DengChu_but_Yes").css("box-shadow", "0px 0px " + DengChu_but_Yes_Jishu + "px 0px #FF0000");
						$(".DengChu_but_Yes").css("text-shadow", "#FF0000 0px 0px " + DengChu_but_Yes_Jishu + "px");
						DengChu_but_Yes_Jishu--;
						if (DengChu_but_Yes_Jishu <= -1) {
							clearInterval(DengChu_but_Yes_Time2);
						}
					}, 10)
				})
				//登出取消按钮事件
				var DengChu_but_No_Jishu = 0;
				var DengChu_but_No_Time1 = setInterval(function () { });
				var DengChu_but_No_Time2 = setInterval(function () { });
				$(".DengChu_but_No").click(function () {
					if (DengChu_PanDuan == true) {
						$(".Top_TiShi_DengChu").animate({
							top: -80
						}, 500, function () {
							$(".XianTiao_Yi_Shang").css("left", "-200px");
							$(".XianTiao_Yi_You").css("height", "0px");
							$(".XianTiao_Yi_Xia").css("right", "-300px");
							$(".XianTiao_Yi_Zuo").css("top", "130px");
							DengChu_PanDuan = false
						});
					}
				}).mouseenter(function () {
					clearInterval(DengChu_but_No_Time2);
					DengChu_but_No_Time1 = setInterval(function () {
						$(".DengChu_but_No").css("box-shadow", "0px 0px " + DengChu_but_No_Jishu + "px 0px #33FFFF");
						$(".DengChu_but_No").css("text-shadow", "#33FFFF 0px 0px " + DengChu_but_No_Jishu + "px");
						DengChu_but_No_Jishu++;
						if (DengChu_but_No_Jishu >= 15) {
							clearInterval(DengChu_but_No_Time1);
						}
					}, 10)
				}).mouseleave(function () {
					clearInterval(DengChu_but_No_Time1);
					DengChu_but_No_Time2 = setInterval(function () {
						$(".DengChu_but_No").css("box-shadow", "0px 0px " + DengChu_but_No_Jishu + "px 0px #33FFFF");
						$(".DengChu_but_No").css("text-shadow", "#33FFFF 0px 0px " + DengChu_but_No_Jishu + "px");
						DengChu_but_No_Jishu--;
						if (DengChu_but_No_Jishu <= -1) {
							clearInterval(DengChu_but_No_Time2);
						}
					}, 10)
				})

				//登出线条移动
				$(".XianTiao_Yi_You").animate({
					height: 42
				}, 150, function () {
					$(".XianTiao_Yi_Xia").animate({
						right: 0
					}, 400, function () {
						$(".XianTiao_Yi_Zuo").animate({
							top: 5
						}, 250, function () {
							$(".XianTiao_Yi_Shang").animate({
								left: 0
							}, 300, function () {
								DengChu_PanDuan = true;
							})
						})
					})
				})
			})
		}
		if (DengChu_PanDuan == true) {
			$(".Top_TiShi_DengChu").animate({
				top: -80
			}, 500, function () {
				$(".XianTiao_Yi_Shang").css("left", "-200px");
				$(".XianTiao_Yi_You").css("height", "0px");
				$(".XianTiao_Yi_Xia").css("right", "-300px");
				$(".XianTiao_Yi_Zuo").css("top", "130px");
				DengChu_PanDuan = false;
			});
		}
	})

	//侧边栏消失
	var a;
	$(".home_left").mouseenter(function () {
		a = $(".list-sidebar").animate({
			marginLeft: 70
		}, 300)
	}).mouseleave(function () {
		a.stop(true);
		$(".list-sidebar").animate({
			marginLeft: -2
		}, 500)
	})
	//切换_账号提示
	var number_PanDuan1 = true;
	if ($(".QieHuan_User").val() == "") {
		$(".QieHuan_User").val("UserNumber");
		$(".QieHuan_User").addClass("Color_Hui");
	}
	//切换_密码提示
	if ($(".QieHuan_Pwd").val() == "") {
		$(".QieHuan_Pwd").val("UserPwd");
		$(".QieHuan_Pwd").addClass("Color_Hui");
	}
	//账号框
	var user_time1 = setInterval(function () { });
	var user_time2 = setInterval(function () { });
	var uesr_jishu = 0;
	$(".QieHuan_User").focus(function () {
		//提示消失
		if ($(".QieHuan_User").val() == "UserNumber") {
			$(".QieHuan_User").toggleClass("Color_Hei Color_Hui");
			$(".QieHuan_User").val("");
		}
		//泛光
		$(".QieHuan_User").css("border", "red 1px solid");
		user_time1 = setInterval(function () {
			$(".QieHuan_User").css("boxShadow", "0px 0px " + uesr_jishu + "px 0px red")
			uesr_jishu++;
			if (uesr_jishu >= 15) {
				clearInterval(user_time1);
			}
		}, 10)
	}).blur(function () {
		//判断账号合法性(是否是数字)
		var number = $(".QieHuan_User").val();
		if ((isNaN(number) == true && number != "UserNumber")) {
			$(".QieHuan_User_TiShi").text("账号类型不正确");
			number_PanDuan1 = false;
		} else {
			$(".QieHuan_User_TiShi").text("");
			number_PanDuan1 = true;
		}
		//提示显示
		if ($(".QieHuan_User").val() == "") {
			$(".QieHuan_User").toggleClass("Color_Hei Color_Hui");
			$(".QieHuan_User").val("UserNumber");
		}
		//泛光
		$(".QieHuan_User").css("border", "#000000 1px solid");
		user_time2 = setInterval(function () {
			$(".QieHuan_User").css("boxShadow", "0px 0px " + uesr_jishu + "px 0px red")
			uesr_jishu--;
			if (uesr_jishu <= 0) {
				clearInterval(user_time2);
			}
		}, 10)
	})
	//密码框
	var pwd_time1 = setInterval(function () { });
	var pwd_time2 = setInterval(function () { });
	var pwd_jishu = 0
	$(".QieHuan_Pwd").focus(function () {
		if ($(".QieHuan_Pwd").val() == "UserPwd") {
			$(".QieHuan_Pwd").toggleClass("Color_Hei Color_Hui");
			$(".QieHuan_Pwd").val("");
		}
		//泛光
		$(".QieHuan_Pwd").css("border", "red 1px solid");
		pwd_time1 = setInterval(function () {
			$(".QieHuan_Pwd").css("boxShadow", "0px 0px " + pwd_jishu + "px 0px red")
			pwd_jishu++;
			if (pwd_jishu >= 15) {
				clearInterval(pwd_time1);
			}
		}, 10)
	}).blur(function () {
		//泛光
		$(".QieHuan_Pwd").css("border", "#000000 1px solid");
		pwd_time2 = setInterval(function () {
			$(".QieHuan_Pwd").css("boxShadow", "0px 0px " + pwd_jishu + "px 0px red")
			pwd_jishu--;
			if (pwd_jishu <= 0) {
				clearInterval(pwd_time2);
			}
		}, 10)
	})


})